#ifndef DICE_H
#define DICE_H
#include <QGraphicsObject>
#include <QObject>
#include <QPropertyAnimation>
#include <QList>
/*

  DICE CLASS


  */


class Dice : public QGraphicsObject
{
    Q_OBJECT
    Q_PROPERTY(int side READ getSide WRITE setSide)
public:
    Dice(QGraphicsObject* parent);
    ~Dice();
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    int getSide();
    void setSide(int s);
protected:
    int _side;
    int width, height;
    QPropertyAnimation* anim;    
    QList<QPixmap> *diceImages;
signals:
    void stopSignal();
protected slots:
    void stop();
};

/*

  DICE MANAGER CLASS

  */

class DiceManager : public QGraphicsObject
{
    Q_OBJECT
public:
    DiceManager(QGraphicsObject* parent);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void addDice();
protected:
    int noOfDice;
signals:
    void finished();
protected slots:
    void subDice();
};

#endif // DICE_H
